<template>
  <a-modal
    :visible="visible"
    title="提示"
    @cancel="cancel"
    :width="900"
  >
    <a-table
      bordered
      :columns="columns"
      :data-source="errorData"
      :pagination="false"
      :scroll="{y : 500}"
    >
      <span
        slot="number"
        slot-scope="text, record, index"
      >{{ index + 1 }}</span>
    </a-table>
    <template slot="footer">
      <a-button
        type="primary"
        @click="cancel"
      > 确定 </a-button>
    </template>
  </a-modal>
</template>
<script>
const columns = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '提示内容',
    dataIndex: 'message',
    ellipsis: true
  }
]
export default {
  name: 'a' + Date.now(),
  props: {
    visible: {
      value: false,
      type: Boolean
    },
    errorData: {
      value: [],
      type: Array
    }
  },
  data() {
    this.columns = columns
    return {}
  },
  methods: {
    cancel() {
      this.$emit('update:visible', false)
    }
  }
}
</script>
  